package ynu.edu.domain.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotBlank;
import java.math.BigDecimal;

/**
 * ControlNet单元DTO
 */
@Data
@ApiModel(description = "ControlNet单元参数")
public class ControlNetUnit {

    @ApiModelProperty(value = "ControlNet模块名称", example = "canny", required = true)
    @NotBlank(message = "模块名称不能为空")
    private String module;

    @ApiModelProperty(value = "ControlNet模型名称", example = "control_v11p_sd15_canny [d14c016b]", required = true)
    @NotBlank(message = "模型名称不能为空")
    private String model;

    @ApiModelProperty(value = "权重", example = "0.65")
    @DecimalMin(value = "0.0", message = "权重不能小于0")
    @DecimalMax(value = "2.0", message = "权重不能大于2")
    private BigDecimal weight = new BigDecimal("1.0");

    @ApiModelProperty(value = "调整模式", example = "Crop and Resize")
    private String resizeMode = "Crop and Resize";

    @ApiModelProperty(value = "处理器分辨率", example = "512")
    private Integer processorRes = 512;

    @ApiModelProperty(value = "阈值A", example = "64.0")
    private BigDecimal thresholdA;

    @ApiModelProperty(value = "阈值B", example = "128.0")
    private BigDecimal thresholdB;

    @ApiModelProperty(value = "引导开始", example = "0.0")
    @DecimalMin(value = "0.0", message = "引导开始不能小于0")
    @DecimalMax(value = "1.0", message = "引导开始不能大于1")
    private BigDecimal guidanceStart = new BigDecimal("0.0");

    @ApiModelProperty(value = "引导结束", example = "1.0")
    @DecimalMin(value = "0.0", message = "引导结束不能小于0")
    @DecimalMax(value = "1.0", message = "引导结束不能大于1")
    private BigDecimal guidanceEnd = new BigDecimal("1.0");

    @ApiModelProperty(value = "像素完美", example = "true")
    private Boolean pixelPerfect = true;

    @ApiModelProperty(value = "控制模式", example = "Balanced")
    private String controlMode = "Balanced";

    @ApiModelProperty(value = "输入图片base64编码", required = true)
    @NotBlank(message = "输入图片不能为空")
    private String inputImage;
} 